package com.kotlin.use.api

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.kotlin.use.bean.User

@Dao
interface RoomUsers {
    @Query("SELECT * FROM users")
    fun getUsers(): List<User>

    @Query("UPDATE users SET age = :age WHERE name = :name")
    fun updateUser(name: String, age: Int)

    @Query("DELETE FROM users WHERE name = :name")
    fun deleteUser(name: String)

    @Insert
    fun insertUser(user: User)
}
